import React from 'react';
import Bread from '../../component/TableContent/VipBread';
import { Button ,Input} from 'antd';
import { withRouter } from 'react-router-dom'
import hoc from '../../component/InputHoc/Input-Hoc';
import AccountChange from '../../component/InputHoc/Accountchange'
import { inject, observer } from 'mobx-react'
import { toJS} from 'mobx'
import './LookAccount.css'

//调整会员账户
@hoc
@withRouter
@inject('getall')
@observer
class AdjustAccount extends React.Component {
  golookaccount = () => {
    this.props.history.push('/Home/huiYuan/LookAccount')
  }
  chuanhouduan = () => {
    console.log(toJS(this.props.getall.account));
  }
  cleardata = () => {
    // this.props.getall.clearAccount()
    window.location.reload() 
  }
  render() {
    // console.log(this.props);
    let { getvalue } = this.props
    console.log(toJS(this.props.getall.account));
  return (
  <div>
    <Bread mianbao='调整会员账户'></Bread>
    <div className='controlBtn'>
      <Button onClick={this.golookaccount}>会员账户变动明细</Button>
    </div>
    <div className='addjustform'>
        账户变动原因<Input placeholder="请输入账户变动原因，回车键确定" allowClear onPressEnter={getvalue({...this.props})} />
        <hr />
        <AccountChange acname='可用资金账户' chdata='canuse' {...this.props}></AccountChange>
        <hr />
        <AccountChange acname='冻结资金账户' chdata='freeze' {...this.props}></AccountChange>
        <hr />
        <AccountChange acname='等级积分账户' chdata='level' {...this.props}></AccountChange>
        <hr />
        <AccountChange acname='消费资金账户' chdata='spend' {...this.props}></AccountChange>
    </div>
    <Button className='surename' onClick={this.chuanhouduan} >确定</Button>
    <Button className='surename' onClick={this.cleardata}>取消</Button>
  </div>
);
}
}
export default AdjustAccount;